package com.lxq.blog.com.lxq.blog.service;

import com.lxq.blog.com.lxq.blog.dao.BlogDao;
import com.lxq.blog.com.lxq.blog.entity.Blog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class BlogService {
    @Autowired
    BlogDao dao;

    public boolean saveBlog(Blog blog){
        return dao.saveBlog(blog);
    }

    public boolean updateById(Blog blog){
        return dao.updateById(blog);
    }

    public ArrayList<Blog> findAll(){
        return dao.findAll();
    }
    public Blog findById(String id){
        return dao.findById(id);
    }

    public boolean deleteById(String id){
        return dao.deleteById(id);
    }

    public int thumbUp(String id){
        dao.thumbUp(id);
        return dao.queryThumbById(id);
    }

    public boolean viewUp(String id){
        return dao.viewUp(id);
    }
}
